import javax.microedition.lcdui.game.TiledLayer;

public class TileScore extends TiledLayer {
	
	private int digitNumber;

	public TileScore(int digitNumber) {
		super(digitNumber, 1,
				ThemeManager.Digits,
				ThemeManager.Digits.getWidth(),
				ThemeManager.Digits.getHeight() / 10);
		this.digitNumber = digitNumber;
	}
	
	public void setScore(int score) {
		for (int i = digitNumber - 1; i >= 0; i--) {
			int x = score % 10;
			setCell(i, 0, x + 1);
			score /= 10;
		}
	}

}
